package main

import (
	"../fileutil"
	"../picutil"
	"bufio"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
)

func main() {

	scanner := bufio.NewReader(os.Stdin)

	picturePath, _ := fileutil.GetInputLine(scanner, "请输入壁纸目录")

	pictures, _ := ioutil.ReadDir(picturePath)
	for _, picture := range pictures {
		fileName := picture.Name()
		config := picutil.Config(filepath.Join(picturePath, fileName))
		if config.Height < 2160 && config.Width < 3840 {
			fmt.Printf("%s 的长 %d < 3840， 宽 %d < 2160\n", fileName, config.Width, config.Height)
			continue
		}
		if config.Height == 2160 && config.Width < 3840 {
			fmt.Printf("%s 的宽 %d < 3840\n", fileName, config.Width)
			continue
		}
		if config.Width == 2160 && config.Height < 2160 {
			fmt.Printf("%s 的长 %d < 2160\n", fileName, config.Height)
			continue
		}
		if config.Height > 2160 && config.Width > 3840 {
			fmt.Printf("%s 的长 %d > 3840， 宽 %d > 2160\n", fileName, config.Width, config.Height)
		}
	}

}
